﻿@model shop.SanPham

@{
    Layout = "~/Views/Shared/_layoutAdmin.cshtml";
}
<script type="text/javascript" src="@Url.Content("~/plugin/ckEditor/ckeditor.js")"></script>
<link href="@Url.Content("~/Plugin/Uploadify/uploadify.css")" rel="stylesheet" />
<script src="@Url.Content("~/Plugin/Uploadify/jquery.uploadify.js")"></script>
  @using (Html.BeginForm("edit", "sanpham", FormMethod.Post, new { enctype = "multipart/form-data" }))
  {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true) 
            @Html.HiddenFor(model => model.ID)
    
            <div class="editor-label">
                Mã sản Phẩm
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.MaSP)
                @Html.ValidationMessageFor(model => model.MaSP)
            </div>
    
            <div class="editor-label">
                Tên Sản Phẩm
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.TenSP)
                @Html.ValidationMessageFor(model => model.TenSP)
            </div>
    
            <div class="editor-label">
              Giá 
            </div>
            <div class="editor-field">
               @* @Html.EditorFor(model => model.Gia)*@
                <input type="text" name="Gia" class="gia" id="gia" value="@string.Format("{0:0}",Model.Gia)" />
                @Html.ValidationMessageFor(model => model.Gia)
            </div>
    
            <div class="editor-label">
               Nội dung
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(model => model.NoiDung, new { @id = "noidungsanpham" })

                <script type="text/javascript">
                    CKEDITOR.replace("noidungsanpham", {
                        toolbar: [
                            { name: 'document', items: ['Source', '-', 'NewPage', 'Preview', '-', 'Templates'] },	// Defines toolbar group with name (used to create voice label) and items in 3 subgroups.
                            ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'],			// Defines toolbar group without name.
                            '/',																					// Line break - next group will be placed in new line.
                            { name: 'basicstyles', items: ['Bold', 'Italic'] }
                        ]
                    });
                </script>
                @Html.ValidationMessageFor(model => model.NoiDung)
            </div>
    
            <div class="editor-label">
                Mã Nghề Nghiệp
            </div>
            <div class="editor-field">
               
                @Html.Action("dropnn", "Partial", new {MaNN = Model.MaNN, type = "1" })
                @Html.ValidationMessageFor(model => model.MaNN)
            </div>
    
            <div class="editor-label">
               Mã Thương Hiệu
            </div>
            <div class="editor-field">
               @Html.Action("dropthTH", "Partial", new { MaTH = Model.MaTH , type="1"})
                @Html.ValidationMessageFor(model => model.MaTH)
            </div>
    
            <div class="editor-label">
                Mã Danh Mục
            </div>
            <div class="editor-field">
                @Html.Action("dropdm", "Partial", new { MaDM=Model.MaDM,type = "1" })
                @Html.ValidationMessageFor(model => model.MaDM)
            </div>
    
            <div class="editor-label">
              Hình Ảnh
            </div>
            <div class="editor-field">
                <img width="175" src="/images/sanpham/@Model.HinhAnh" />
                <input name="AnhMoi" type="file" />
                @Html.HiddenFor(model => model.HinhAnh)
                @Html.ValidationMessageFor(model => model.HinhAnh)
            </div>
    
            <p>
                <input type="submit" value="Sửa" />
            </p>
       
  }
    
